/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.rooms;

import java.util.LinkedList;
import java.util.List;
import javax.swing.AbstractListModel;

/**
 *
 * @author Mrkupi
 */
public class RoomChatModel  extends AbstractListModel
{
    private List<String> roomNames;
    
    public RoomChatModel()
    {
        this.roomNames = new LinkedList();
    }
    
    @Override
    public int getSize()
    {
        return this.roomNames.size();
    }

    @Override
    public Object getElementAt(int index)
    {
        return this.roomNames.get(index);
    }
    
    public void addRoom(String roomName)
    {
        this.roomNames.add(roomName);
        this.fireIntervalAdded(this, this.roomNames.size() - 1, this.roomNames.size());
    }
}
